package com.yrd.common.webui;

public class ResponseMessage {
	boolean success;
	int code;
	String message;
	Object data;
	
	public static ResponseMessage success(String message){
		ResponseMessage msg = new ResponseMessage();
		msg.setSuccess(true);
		msg.setMessage(message);
		return msg;
	}
	public static ResponseMessage fault(int code,String message){
		ResponseMessage msg = new ResponseMessage();
		msg.setSuccess(false);
		msg.setCode(code);
		msg.setMessage(message);
		return msg;
	}
	public static ResponseMessage fault(String message){
		return fault(-1,message);
	}
	
	
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
	
	
}
